from selenium import webdriver
import time

# selenium.webdriver.chrome.webdriver.WebDriver
driver = webdriver.Chrome()
url = 'http://www.baidu.com'
driver.get(url)

e1 = driver.find_element_by_id("kw")
print(e1)
e1.send_keys("selenium")
el_sub = driver.find_element_by_class_name("s_btn")
el_sub.click()
# 定位搜索结果元素列表
results = driver.find_elements_by_id('container')
print(results)
print(len(results))

time.sleep(1)
driver.close()
